<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.1.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="在做BLE开发中，经常需要抓蓝牙通信包来分析。专业的蓝牙抓包工具非常昂贵，我们可以使用Nordic的开发板来进行抓包还可以使用nRF Connect APP进行简单抓包">
<meta property="og:type" content="article">
<meta property="og:title" content="nRF52832开发记录-蓝牙抓包">
<meta property="og:url" content="http://example.com/2020/06/12/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-%E8%93%9D%E7%89%99%E6%8A%93%E5%8C%85/index.html">
<meta property="og:site_name" content="webuildthings">
<meta property="og:description" content="在做BLE开发中，经常需要抓蓝牙通信包来分析。专业的蓝牙抓包工具非常昂贵，我们可以使用Nordic的开发板来进行抓包还可以使用nRF Connect APP进行简单抓包">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://example.com/2020/06/12/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-%E8%93%9D%E7%89%99%E6%8A%93%E5%8C%85/Sniffer_Wireshark_ExtcapPath.png">
<meta property="og:image" content="http://example.com/2020/06/12/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-%E8%93%9D%E7%89%99%E6%8A%93%E5%8C%85/Sniffer_Wireshark_PersonalConfiguration.png">
<meta property="og:image" content="http://example.com/2020/06/12/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-%E8%93%9D%E7%89%99%E6%8A%93%E5%8C%85/Sniffer_Wireshark_OK.png">
<meta property="article:published_time" content="2020-06-12T10:55:26.000Z">
<meta property="article:modified_time" content="2020-09-02T05:55:26.684Z">
<meta property="article:author" content="wusk">
<meta property="article:tag" content="BLE">
<meta property="article:tag" content="Nordic">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://example.com/2020/06/12/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-%E8%93%9D%E7%89%99%E6%8A%93%E5%8C%85/Sniffer_Wireshark_ExtcapPath.png">

<link rel="canonical" href="http://example.com/2020/06/12/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-%E8%93%9D%E7%89%99%E6%8A%93%E5%8C%85/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>nRF52832开发记录-蓝牙抓包 | webuildthings</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">webuildthings</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">遇酒且呵呵 人生能几何</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2020/06/12/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-%E8%93%9D%E7%89%99%E6%8A%93%E5%8C%85/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="wusk">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="webuildthings">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          nRF52832开发记录-蓝牙抓包
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-06-12 18:55:26" itemprop="dateCreated datePublished" datetime="2020-06-12T18:55:26+08:00">2020-06-12</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-09-02 13:55:26" itemprop="dateModified" datetime="2020-09-02T13:55:26+08:00">2020-09-02</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/nRF52832/" itemprop="url" rel="index"><span itemprop="name">nRF52832</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/nRF52832/BLE/" itemprop="url" rel="index"><span itemprop="name">BLE</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>在做BLE开发中，经常需要抓蓝牙通信包来分析。<br>专业的蓝牙抓包工具非常昂贵，我们可以使用Nordic的开发板来进行抓包<br>还可以使用<code>nRF Connect APP</code>进行简单抓包    </p>
<a id="more"></a> 

<h1 id="1-硬件"><a href="#1-硬件" class="headerlink" title="1 硬件"></a>1 硬件</h1><p>Nordic nRF52 开发板 PCA10040</p>
<h1 id="2-软件"><a href="#2-软件" class="headerlink" title="2 软件"></a>2 软件</h1><ul>
<li>Wireshark v2.4.6 以上 <a target="_blank" rel="noopener" href="https://www.wireshark.org/">https://www.wireshark.org/</a></li>
<li>Python v3.6 以上 <a target="_blank" rel="noopener" href="https://www.python.org/downloads/">https://www.python.org/downloads/</a></li>
<li>nRF Sniffer for Bluetooth LE v3.x 以上 <a target="_blank" rel="noopener" href="https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE/Download#infotabs">Sniffer_Software</a>    </li>
</ul>
<h1 id="3-安装"><a href="#3-安装" class="headerlink" title="3 安装"></a>3 安装</h1><h2 id="3-1-更新硬件固件"><a href="#3-1-更新硬件固件" class="headerlink" title="3.1 更新硬件固件"></a>3.1 更新硬件固件</h2><p> 将<code>Sniffer_Software/hex/sniffer_pca10040_129d2b3.hex</code>下载到开发板PCA10040中</p>
<h2 id="3-2-配置Wireshark环境"><a href="#3-2-配置Wireshark环境" class="headerlink" title="3.2 配置Wireshark环境"></a>3.2 配置Wireshark环境</h2><p>蓝牙嗅探功能是以插件形式安装到Wireshark中.  </p>
<h3 id="3-2-1-安装pyserial"><a href="#3-2-1-安装pyserial" class="headerlink" title="3.2.1 安装pyserial"></a>3.2.1 安装pyserial</h3><p>cmd命令行进入<code>Sniffer_Software/extcap/</code> 执行命令 <code> pip3 install -r requirements.txt</code></p>
<h3 id="3-2-2-拷贝工具到Wireshark"><a href="#3-2-2-拷贝工具到Wireshark" class="headerlink" title="3.2.2 拷贝工具到Wireshark"></a>3.2.2 拷贝工具到Wireshark</h3><p>将<code>Sniffer_Software/extcap/</code>中的所有内容拷贝到<code>Wireshark</code>的<code>extcap</code>文件夹中.位置在<code>帮助--&gt;关于Wireshark</code>中,如下图:<br><img src="Sniffer_Wireshark_ExtcapPath.png" width="50%" height="50%"></p>
<h3 id="3-2-3-开启插件"><a href="#3-2-3-开启插件" class="headerlink" title="3.2.3 开启插件"></a>3.2.3 开启插件</h3><p>在<code>Wireshark</code>中按<code>F5</code>刷新下，然后在菜单中使能新装的插件:<br><code> 视图 --&gt; 接口工具 --&gt; nRF Sniffer for Bluetooth LE</code>    </p>
<h3 id="3-2-4-添加配置文件"><a href="#3-2-4-添加配置文件" class="headerlink" title="3.2.4 添加配置文件"></a>3.2.4 添加配置文件</h3><p>添加配置文件以便更清晰的显示数据<br>将<code>Sniffer_Software/Profile_nRF_Sniffer_Bluetooth_LE</code>整个文件夹拷贝到<code>Wireshark</code>的<code>个人配置</code>文件夹中.<br>启用<code>Edit &gt; Configuration Profiles &gt; Profile_nRF_Sniffer_Bluetooth_LE &gt; OK</code><br><img src="Sniffer_Wireshark_PersonalConfiguration.png" alt="PersonalConfiguration"></p>
<h1 id="4-运行"><a href="#4-运行" class="headerlink" title="4. 运行"></a>4. 运行</h1><p>双击接口即可进入抓包界面，从<code>Device</code>选择框内选择要监听的设备即可只显示该设备的数据包<br><img src="Sniffer_Wireshark_OK.png" alt="run"></p>
<h1 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h1><p><a target="_blank" rel="noopener" href="https://infocenter.nordicsemi.com/index.jsp?topic=/ug_getting_started/UG/gs/product_development.html&cp=1_0">nRF Sniffer for Bluetooth LE</a></p>

    </div>

    
    
    

      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/tags/BLE/" rel="tag"><i class="fa fa-tag"></i> BLE</a>
              <a href="/tags/Nordic/" rel="tag"><i class="fa fa-tag"></i> Nordic</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/06/08/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-pwm%E5%AE%9E%E7%8E%B0%E5%91%BC%E5%90%B8%E7%81%AF/" rel="prev" title="nRF52832开发记录-pwm实现呼吸灯">
      <i class="fa fa-chevron-left"></i> nRF52832开发记录-pwm实现呼吸灯
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/06/15/nRF52832%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95-nRFConnect/" rel="next" title="nRF52832开发记录-nRFConnect">
      nRF52832开发记录-nRFConnect <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#1-%E7%A1%AC%E4%BB%B6"><span class="nav-number">1.</span> <span class="nav-text">1 硬件</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#2-%E8%BD%AF%E4%BB%B6"><span class="nav-number">2.</span> <span class="nav-text">2 软件</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3-%E5%AE%89%E8%A3%85"><span class="nav-number">3.</span> <span class="nav-text">3 安装</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#3-1-%E6%9B%B4%E6%96%B0%E7%A1%AC%E4%BB%B6%E5%9B%BA%E4%BB%B6"><span class="nav-number">3.1.</span> <span class="nav-text">3.1 更新硬件固件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-2-%E9%85%8D%E7%BD%AEWireshark%E7%8E%AF%E5%A2%83"><span class="nav-number">3.2.</span> <span class="nav-text">3.2 配置Wireshark环境</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-1-%E5%AE%89%E8%A3%85pyserial"><span class="nav-number">3.2.1.</span> <span class="nav-text">3.2.1 安装pyserial</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-2-%E6%8B%B7%E8%B4%9D%E5%B7%A5%E5%85%B7%E5%88%B0Wireshark"><span class="nav-number">3.2.2.</span> <span class="nav-text">3.2.2 拷贝工具到Wireshark</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-3-%E5%BC%80%E5%90%AF%E6%8F%92%E4%BB%B6"><span class="nav-number">3.2.3.</span> <span class="nav-text">3.2.3 开启插件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-4-%E6%B7%BB%E5%8A%A0%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="nav-number">3.2.4.</span> <span class="nav-text">3.2.4 添加配置文件</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#4-%E8%BF%90%E8%A1%8C"><span class="nav-number">4.</span> <span class="nav-text">4. 运行</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%8F%82%E8%80%83"><span class="nav-number">5.</span> <span class="nav-text">参考</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">wusk</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">34</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">10</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">wusk</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
